<?php ob_start();
    include("mysql.php");
    $a=1;
    $thisopid = $_POST['opid'];
    
    $ver=mysql_query("SELECT * FROM message where opid = '$thisopid'  order by time desc ");
    while(!empty($result=mysql_fetch_assoc($ver))){
        $id=$result['id'];
        $mes=$result['mes_text'];
        $code=0;
        $array=array();
        $pic=mysql_query("SELECT * FROM picture where follow = '$id' order by time asc ");
        while(!empty($picc=mysql_fetch_assoc($pic))){
            $array[]=$picc['url'];
            };
            if($result['visible'] == 1){
            $data=array(
            //'opid'=>$result['opid'], 
            'id'=>$id, 
            'message'=>$mes,
            'time'=>$result['time'],
            'picture'=>$array
                );
            }
            else{
            $data=array(
            //'opid'=>$result['opid'], 
            'id'=>$id, 
            'message'=>"审核中...",
            'time'=>$result['time'],
            'picture'=>''
        );
            }
        $ret=array(
            'code'=>$code,
            'data'=>$data,
        
        );
        header('Content-Type:application/json; charset=utf-8');
        if($a!=1){
                echo(',');
                echo(json_encode($ret,JSON_UNESCAPED_UNICODE));
            }
            else{
                echo('[');
                echo(json_encode($ret,JSON_UNESCAPED_UNICODE));
                $a--;
            }
    }
    echo(']');

?>
